/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.zonasoft.entidades;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author JORGE
 */
@Entity
@Table(name = "lider", catalog = "zonificacion", schema = "")
@NamedQueries({
    @NamedQuery(name = "Lider.findAll", query = "SELECT l FROM Lider l"),
    @NamedQuery(name = "Lider.findByIdlider", query = "SELECT l FROM Lider l WHERE l.idlider = :idlider"),
    @NamedQuery(name = "Lider.findByNombre", query = "SELECT l FROM Lider l WHERE l.nombre = :nombre"),
    @NamedQuery(name = "Lider.findByApellido", query = "SELECT l FROM Lider l WHERE l.apellido = :apellido"),
    @NamedQuery(name = "Lider.findByEdad", query = "SELECT l FROM Lider l WHERE l.edad = :edad"),
    @NamedQuery(name = "Lider.findByCorreo", query = "SELECT l FROM Lider l WHERE l.correo = :correo"),
    @NamedQuery(name = "Lider.findByTelefono", query = "SELECT l FROM Lider l WHERE l.telefono = :telefono"),
    @NamedQuery(name = "Lider.findByDireccion", query = "SELECT l FROM Lider l WHERE l.direccion = :direccion")})
public class Lider implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idlider", nullable = false, length = 20)
    private String idlider;
    @Column(name = "nombre", length = 45)
    private String nombre;
    @Column(name = "apellido", length = 45)
    private String apellido;
    @Column(name = "edad", length = 3)
    private String edad;
    @Column(name = "correo", length = 45)
    private String correo;
    @Column(name = "telefono", length = 45)
    private String telefono;
    @Column(name = "direccion", length = 45)
    private String direccion;
    @OneToMany(mappedBy = "idlider")
    private List<Zonificados> zonificadosList;
    @OneToMany(mappedBy = "idlider1")
    private List<Zonificados> zonificadosList1;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idLider")
    private List<LiderCandidato> liderCandidatoList;

    public Lider() {
    }

    public Lider(String idlider) {
        this.idlider = idlider;
    }

    public String getIdlider() {
        return idlider;
    }

    public void setIdlider(String idlider) {
        this.idlider = idlider;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getApellido() {
        return apellido;
    }

    public void setApellido(String apellido) {
        this.apellido = apellido;
    }

    public String getEdad() {
        return edad;
    }

    public void setEdad(String edad) {
        this.edad = edad;
    }

    public String getCorreo() {
        return correo;
    }

    public void setCorreo(String correo) {
        this.correo = correo;
    }

    public String getTelefono() {
        return telefono;
    }

    public void setTelefono(String telefono) {
        this.telefono = telefono;
    }

    public String getDireccion() {
        return direccion;
    }

    public void setDireccion(String direccion) {
        this.direccion = direccion;
    }

    public List<Zonificados> getZonificadosList() {
        return zonificadosList;
    }

    public void setZonificadosList(List<Zonificados> zonificadosList) {
        this.zonificadosList = zonificadosList;
    }

    public List<Zonificados> getZonificadosList1() {
        return zonificadosList1;
    }

    public void setZonificadosList1(List<Zonificados> zonificadosList1) {
        this.zonificadosList1 = zonificadosList1;
    }

    public List<LiderCandidato> getLiderCandidatoList() {
        return liderCandidatoList;
    }

    public void setLiderCandidatoList(List<LiderCandidato> liderCandidatoList) {
        this.liderCandidatoList = liderCandidatoList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idlider != null ? idlider.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Lider)) {
            return false;
        }
        Lider other = (Lider) object;
        if ((this.idlider == null && other.idlider != null) || (this.idlider != null && !this.idlider.equals(other.idlider))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.zonasoft.enridades.Lider[idlider=" + idlider + "]";
    }

}
